#include <stdio.h>


void ShellSort(int* arr, int size) 
{
	int dk, i, j;
	for (dk = size / 2; dk >= 1; dk /= 2)
	{
		for (i = dk; i < size; ++i)
		{
			if (arr[i] < arr[i - dk])
			{
				int tmp = arr[i];
				for (j = i - dk; j >= 0 && arr[j] > tmp; j -= dk)
					arr[j + dk] = arr[j];
				arr[j + dk] = tmp;
			}
		}
	}
}


int main() 
{
	int arr[] = { 38, 84, 132, 5, 32, 543, 62, 64, 1, 235, 54543, 124, 4313, 454, 22, 0, 11 };
	int size = sizeof(arr) / sizeof(arr[0]);

	ShellSort(arr, size);

	for (int i = 0; i < size; ++i) {
		printf("%d ", arr[i]);
	}

	return 0;
}

